from tortoise import fields, models
class FoundLot(models.Model):
    id = fields.BigIntField(pk=True)
    record_status = fields.IntField(default=1, description="记录状态:1-有效;0-无效")
    create_time = fields.DatetimeField(auto_now_add=True, description="记录创建时间")
    update_time = fields.DatetimeField(auto_now=True, description="记录修改时间")
    lot_code = fields.CharField(max_length=50, default='', description="基金批次编码")
    lot_update_date = fields.DateField(null=True, description="基金已更新日期")
    type = fields.CharField(max_length=50, default='', description="更新方式：自动更新手工更新")
    remark = fields.CharField(max_length=200, null=True, description="描述")
    found_code = fields.CharField(max_length=50, default='', description="基金编码")
    found_name = fields.CharField(max_length=200, default='', description="基金名称")
    start_date = fields.DateField(null=True, description="开始日期")
    end_date = fields.DateField(null=True, description="结束日期")
    fore_earn_amount = fields.DecimalField(max_digits=10, decimal_places=2, default=0.00, description="预期收益金额")
    cur_amount = fields.DecimalField(max_digits=10, decimal_places=2, default=0.00, description="最新市值")
    base_si_price = fields.DecimalField(max_digits=10, decimal_places=4, default=0.0000, description="基准单价")
    base_amount = fields.DecimalField(max_digits=10, decimal_places=2, default=0.00, description="基准成本")
    base_shares = fields.DecimalField(max_digits=10, decimal_places=2, default=0.00, description="基准份额：最低份额,低于这个份额的情况下,除非预期收益达标,否则不进行卖出操作")
    cur_earn_amount = fields.DecimalField(max_digits=10, decimal_places=2, default=0.00, description="最新盈亏金额")

    class Meta:
        table = "found_lot"
        table_description = "基金批次"
